package com.hyk.feign;

import com.hyk.config.auth.OAuth2FeignConfig;
import com.hyk.dto.AccountDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

@FeignClient(value = "finance-service",
            contextId = "account",
            configuration = OAuth2FeignConfig.class,
            path = "account")
public interface AccountFeign {

    @GetMapping("/getUserAccountByCoinId")
    public AccountDto getUserAccountByCoinId(@RequestParam("coinId") Long coinId,@RequestParam("userId") Long userId);

    @GetMapping("/transferUserLock")
    Boolean transferUserLock(@RequestParam("coinId") Long coinId,
                             @RequestParam("userId") Long userId,
                             @RequestParam("amount") BigDecimal amount,
                             @RequestParam("orderId") Long orderId);
}
